<?php
/**
 * Each engineer has a duty to keep the code elegant
 * Created by wolffy.
 * Author @wolffy<13750088090@sina.cn>
 * Date: 2018/8/6
 * Time: 14:40
 */
namespace App\Http\Controllers\Api\V1_0_1;

use App\Services\PassportService;

class BaseController extends ApiController
{
    protected $user;

    protected $passportService;

    public function __construct()
    {
        $this->passportService = new PassportService();
        $this->user = $this->passportService->userInfo();
        if (empty($this->user)) {
            die('{"code":403,"msg":"Forbidden","message":""}');
        }
    }
//
//    protected function getAccessToken()
//    {
//        $header = Request::header('Authorization');
//        if (Str::startsWith($header, 'Bearer ')) {
//            return Str::substr($header, 7);
//        }
//        return "";
//    }
}